package top.mayyd.customerdemo.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.mayyd.customerdemo.dao.UserDao;
import top.mayyd.productservice.domain.User;

import java.util.ArrayList;
import java.util.List;

@Service
public class UserService {
    @Autowired
    private UserDao userDao;

    public User queryUserById(Long id) {
        return this.userDao.queryUserById(id);
    }

    public List<User> queryUsersByIds(List<Long> ids) {
        List<User> users = new ArrayList<>();
        for (Long id: ids) {
            users.add(userDao.queryUserById(id));
        }

        return users;
    }
}
